import { defineComponent } from "vue";
import { ButtonGroupProps, IButtonGroupViewData } from "./types";
import { Button } from "vant";
import ButtonView from "../ButtonView";
export default defineComponent({
  name: "button-group-view",
  props: ButtonGroupProps,
  setup(props) {
    return () => {
      const renderItem = (item: IButtonGroupViewData) => {
        return (
          <ButtonView
            {...item}
            style={item.style}
            class={[item.childClass, props.childClass]}
          />
        );
      };
      return (
        <div class="flex w-full justify-between">
          {props.data.map((e) => renderItem(e))}
        </div>
      );
    };
  },
});
